package itsm.isperp.buildtime;

import ro.isdc.wro.extensions.processor.css.YUICssCompressorProcessor;
import ro.isdc.wro.extensions.processor.js.UglifyJsProcessor;
import ro.isdc.wro.manager.factory.standalone.StandaloneWroManagerFactory;
import ro.isdc.wro.model.resource.processor.factory.ProcessorsFactory;
import ro.isdc.wro.model.resource.processor.factory.SimpleProcessorsFactory;
import ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor;
import ro.isdc.wro.model.resource.processor.impl.css.CssUrlRewritingProcessor;
import ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor;
import ro.isdc.wro.model.resource.processor.impl.js.SemicolonAppenderPreProcessor;
import ro.isdc.wro.model.resource.support.naming.TimestampNamingStrategy;

public class CustomWroManagerFactory extends StandaloneWroManagerFactory {

	public CustomWroManagerFactory() {
		setNamingStrategy(new TimestampNamingStrategy());

	}

	@Override
	protected ProcessorsFactory newProcessorsFactory() {

		// ProcessorsFactory factory = super.newProcessorsFactory();

		final SimpleProcessorsFactory factory = new SimpleProcessorsFactory();
		factory.addPreProcessor(new CssImportPreProcessor());
		factory.addPreProcessor(new CssUrlRewritingProcessor());
		factory.addPreProcessor(new SemicolonAppenderPreProcessor());
		factory.addPreProcessor(new YUICssCompressorProcessor());
		factory.addPreProcessor(new UglifyJsProcessor());
		factory.addPostProcessor(new CssVariablesProcessor());
		// factory.addPostProcessor(new UglifyJsProcessor());

		return factory;
	}
}
